
//
//  LYPersonCheckMeCell.m
//  SelectCity
//
//  Created by liuyan on 2019/3/20.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYPersonCheckMeCell.h"

@interface LYPersonCheckMeCell()

@property (nonatomic, strong) UIImageView *iconImage;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *timeLabel;
@property (nonatomic, strong) UILabel *detaileLabel;

@end

@implementation LYPersonCheckMeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

#pragma mark - InitSubViews
- (void)initUI {
    UIView *backview = [[UIView alloc] initWithFrame:self.bounds];
    backview.backgroundColor = COLOR_OF_WHITE;
    [self.contentView addSubview:backview];
    
    self.iconImage = [UIToolsControl initImageViewWithFrame:CGRectMake(15, 15, 50, 50) imageName:@"header_bg"];
    self.iconImage.contentMode = UIViewContentModeScaleAspectFill;
    self.iconImage.layer.cornerRadius = self.iconImage.height/2;
    self.imageView.layer.masksToBounds = YES;
    [backview addSubview:self.iconImage];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.iconImage.right +8, 15, 60, 20)];
    self.titleLabel.textColor = THEMECOLOR_OF_TEXT_333333;
    self.titleLabel.font = FontBold(Font_15);
    [backview addSubview:self.titleLabel];
    
    self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.titleLabel.right, 15, WIDTH - self.titleLabel.right -10, 20)];
    self.timeLabel.textColor = THEMECOLOR_OF_TEXT_9a9a9a;
    self.timeLabel.font = Font(Font_12);
    self.timeLabel.textAlignment = NSTextAlignmentRight;
    [backview addSubview:self.timeLabel];
    
    self.detaileLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.iconImage.right +8, self.titleLabel.bottom+10, WIDTH - self.iconImage.right - 18, 20)];
    self.detaileLabel.textColor = THEMECOLOR_OF_TEXT_666666;
    self.detaileLabel.font = Font(Font_14);
    [backview addSubview:self.detaileLabel];
}

- (void)setModel:(LYPersonCheckMeModel *)model {
    self.titleLabel.text = model.hr_info[@"name"];
    self.detaileLabel.text = [NSString stringWithFormat:@"%@ %@",model.company_name,model.hr_info[@"position"]];
    NSString *time = model.add_time;
    self.timeLabel.text = [NSString stringWithFormat:@"%@",time];
}

@end
